<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%-- 
    Document   : manageUsers
    Created on : Jul 17, 2013, 10:29:02 PM
    Author     : Thanh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="css/user.css">
    </head>
    <body>

        <div class="container">
            <jsp:include page="managerHeader.jsp" />
            <div class="left">
                <h2>Danh mục</h2>
                <jsp:include page="managerMenu.jsp" />
            </div>
            <div class="content">
                <h2>Quản lý người dùng</h2>
                <div>
                    <c:choose>
                        <c:when test="${empty requestScope.users}">
                            <h2>Not found!</h2>
                        </c:when>
                        <c:otherwise>
                            <table border="1">
                                <!-- column headers -->
                                <tr>
                                    <th>Role</th>
                                    <th>Username</th>
                                    <th>Full Name</th>
                                    <th>Birthday</th>
                                    <th>Gender</th>
                                    <th>Address</th>
                                    <th>Email</th>
                                    <th>Visit Count</th>
                                    <th>Created Time</th>
                                    <th>Profile Picture</th>
                                    <th></th>
                                </tr>
                                <!-- column data -->
                                <c:forEach var="user" items="${requestScope.users}">
                                    <tr>
                                        <td>${user.role}</td>
                                        <td>${user.username}</td>
                                        <td>${user.fullName}</td>
                                        <td>${user.birthday}</td>
                                        <td>${user.gender}</td>
                                        <td>${user.address}</td>
                                        <td>${user.email}</td>
                                        <td>${user.visitCount}</td>
                                        <td>${user.createdTime}</td>
                                        <td>${user.profilePicture}</td>
                                        <td><a href="GetUserServlet?id=${user.userID}">Details</a> | <a href="DeleteUserServlet?id=${user.userID}">Delete</a></td>
                                    </tr>
                                </c:forEach>
                            </table>
                        </c:otherwise>
                    </c:choose>
                </div>

            </div>
            <jsp:include page="managerFooter.jsp" />
        </div>

    </body>
</html>